<?php 
namespace Admin\Model;
use Think\Model;
class UserModel extends Model {

	//检测用户名
	public function checkUser($username)
	{
		$sql = "select * from user where username='{$username}'";
		$res = $this->query($sql);
		return $res;
	}

	//检测密码同时要检测用户名
	public function checkPassword($username,$password)
	{	
		$password = md5($password);
		$sql = "select * from user where username='{$username}' and password='{$password}'";
		$res = $this->query($sql);
		return $res;
	}

	//检测验证码$verifycode为用户输入的验证码
	// public function checkVerifycode($verifycode)
	// {
	// 	$res = $this->check_verify($verifycode);
	// 	return $res;
	// }

	// 检测输入的验证码是否正确，$code为用户输入的验证码字符串
	public function check_verify($verifycode, $id = '')
	{
	    $verify = new \Think\Verify();
	    return $verify->check($verifycode, $id);
	}


}












 ?>